package com.dong.mapper;

import com.dong.pojo.Book;
import com.dong.pojo.Reader;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface ReaderMapper {
    //根据卡号查询读者
    Reader selectReaderByUsername(String username);

    //查询所有读者
    List<Reader> selectAllReader();

    //插入读者信息
    int insertReader(Reader reader);

    //根据id更改读者state
    int updateReaderState(@Param("readerId") int bookId,@Param("state") int state);

    //更改读者信息
    int updateReader(Reader reader);

    //搜索读者信息
    List<Reader> selectLike(String keyword);
}
